import React, { Component } from 'react'
import { observer, inject } from 'mobx-react'
import axios from 'axios'
@inject('store')
@observer
class App extends Component {
  componentDidMount() {
    axios.get('http://121.89.205.189:3001/api/pro/list').then(res => {
        // console.log(res)
        this.props.store.changeProList(res.data.data)
      })
  }
  render() {
    console.log(this.props.proList)
    return (
      <div>
          app
          {
            this.props.store.proList.map(item => {
              return <p key = { item.proid }> { item.proname }</p>
              })
          }
      </div>
    )
  }
}
export default App